package com.wondertek.poms.core.manager;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSON;
import com.wondertek.poms.common.constant.Constants;
import com.wondertek.poms.dao.po.PrdCont;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Component
public class EsManager {
    @Autowired
    private AmqpTemplate amqpTemplate;
    
	public void process(PrdCont pc) {
		log.info("ES|发送队列消息开始|媒资ID:{},发送节目:{}", pc.getMmsId(), pc.toString());
		if(pc != null) {
			amqpTemplate.convertAndSend(Constants.QUEUE_ES_PRD_CONT, JSON.toJSONString(pc));
			log.info("发送高级搜索|媒资ID:{},发送节目:{}", pc.getMmsId(), pc.toString());
		}
	}
}
